import {createRouter, createWebHashHistory} from "vue-router";

import SystemIndex from "@/components/SystemIndex";
import LoginPage from "@/components/LoginPage";
import AllAccount from "@/components/pages/AllAccount";
import ConfigPage from "@/components/pages/ConfigPage";
import UserInfo from "@/components/pages/UserInfo";
import OrderBack from "@/components/pages/OrderBack";
import QueryOrder from "@/components/pages/QueryOrder";
import ManageLeft from "@/components/include/ManageLeft.vue";
import SystemSetting from "@/components/pages/SystemSetting.vue";
import AddDishes from "@/components/pages/AddDishes";
import RoleAlert from "@/components/include/RoleAlert";
import UpdatePassword from "@/components/pages/UpdatePassword";
import PermissionControl from "@/components/pages/PermissionControl";

const routes = [

    {path: "/", name: "Login", component: LoginPage},
    {
        path: "/System",
        name: "HelloWorld",
        component: SystemIndex,
        children: [
            {path: "Account", name: "Account", component: AllAccount},
            {path: "Config",  name: "Config",  component: ConfigPage},

            {path: "OrderBack", name: "OrderBack", component: OrderBack},
            {path: "QueryOrder", name: "QueryOrder", component: QueryOrder},
            {path: "AddDishes", name: "AddDishes", component: AddDishes},
            {path: "RoleAlert", name: "RoleAlert", component: RoleAlert},
            {path: "ManageLeft", name: "ManageLeft", component: ManageLeft,
                children:[
                    {path: "", name: "SystemSetting", component: SystemSetting},
                    {path: "UpdatePassword", name: "UpdatePassword", component: UpdatePassword},
                    {path: "PermissionControl", name: "PermissionControl", component: PermissionControl},
                    {path: "UserInfo",  name: "UserInfo",  component: UserInfo},
                    {path: "AllAccount",  name: "AllAccount",  component: AllAccount},
                ]}
        ]
    },];
const router = createRouter({
    history: createWebHashHistory(), routes
})
export default router;